package com.xiangpq.pattern.structuralPatterns.proxyPattern.staticProxy;

/**
 * @author XPQ
 * @function 金士顿厂商
 * @since 2024-03-31
 */
public class UsbKingFactory implements UsbSell {
    @Override
    public float sell(int amount) throws Exception {
        // 128G usb 零售价
        int price = 120;
        if (amount >= 5000) {
            price = 75;
        } else if (amount >= 3000) {
            price = 80;
        } else if (amount >= 1000) {
            price = 85;
        } else {
            throw new Exception("数量至少是1000");
        }
        return price;
    }
}
